<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html;charset=utf-8">
    <%@include file="/views/common/include/taglib.jsp"%>
    <%@include file="/views/common/include/head.jsp"%>
    <link rel="stylesheet" href="${ctx}/css/page/owneraddress.css" type="text/css">
    <script src="${ctx}/js/controllers/mall/ownerAddressController.js" type="text/javascript"></script>
    <script type="text/javascript">
        var ctx = '${ctx}';
        setCtx(ctx);
    </script>   
</head>
<body>
                    <h3 class="new">使用新地址</h3>
                    <form class="addressment">
                        <table class="table-address">
                            <tr>
                                <td><h4 class="left-td">收件人：<em class="emStyle">*</em></h4></td>
                                <td><input  maxlength="50"  id="recepientName" onblur="checkRecepientName()" value="${ownerAddress.recepientName }" class="input-text" type="text" placeholder="不能为昵称，x先生、x小姐等"/></td>
                            </tr>
                            <tr>
                                <td><h4 class="left-td addr-left">收货地址：<em class="emStyle">*</em></h4></td>
                                <td>
                                    <select id="cellRegionId" class="OASelect" onblur="checkCellRegion()" >
                                        <option value="">--区域--</option>
                                        <c:if test="${not empty cellRegions}">
                                            <c:forEach items="${cellRegions}" var="cellRegion" varStatus="status">
                                                <c:if test="${cellRegion.name == cellHouse.regionName}">
                                                    <option id="${cellRegion.name}" value="${cellRegion.id}" selected>
                                                        ${cellRegion.name}
                                                    </option>
                                                </c:if>
                                                <c:if test="${cellRegion.name != cellHouse.regionName}">
                                                <option id="${cellRegion.name}" value="${cellRegion.id}">
                                                    ${cellRegion.name}
                                                </option>
                                            </c:if>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                    <select id="cellUnitId" class="OASelect addr-right" onblur="checkCellUnit()" >
                                        <option value="">--单元--</option>
                                        <c:if test="${not empty cellUnits}">
                                            <c:forEach items="${cellUnits}" var="cellUnit" varStatus="status">
                                                <c:if test="${cellUnit.name == cellHouse.unitName}">
                                                    <option id="${cellUnit.name}" value="${cellUnit.id}" selected>
                                                        ${cellUnit.name}
                                                    </option>
                                                </c:if>
                                                <c:if test="${cellUnit.name != cellHouse.unitName}">
                                                <option id="${cellUnit.name}" value="${cellUnit.id}">
                                                    ${cellUnit.name}
                                                </option>
                                            </c:if>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                </td>
                                <td>
                                    <select id="cellBuildingId" class="OASelect" onblur="checkCellBuilding()" >
                                        <option value="">--楼栋--</option>
                                        <c:if test="${not empty cellBuildings}">
                                            <c:forEach items="${cellBuildings}" var="cellBuilding" varStatus="status">
                                                <c:if test="${cellBuilding.buildingName == cellHouse.buildingName}">
                                                    <option id="${cellBuilding.buildingName}" value="${cellBuilding.id}" selected>
                                                        ${cellBuilding.buildingName}
                                                    </option>
                                                </c:if>
                                                <c:if test="${cellBuilding.buildingName != cellHouse.buildingName}">
                                                <option id="${cellBuilding.buildingName}" value="${cellBuildings.id}">
                                                    ${cellBuilding.buildingName}
                                                </option>
                                            </c:if>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                    <select id="cellHouseId" class="OASelect addr-right" onblur="checkCellHouse()" >
                                        <option value="">--房屋--</option>
                                        <c:if test="${not empty cellHouses}">
                                            <c:forEach items="${cellHouses}" var="cellHouse" varStatus="status">
                                                <option id="${cellHouse.name}" value="${cellHouse.id}" selected>
                                                    ${cellHouse.name}
                                                </option>
                                            </c:forEach>
                                        </c:if>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td><h4 class="left-td">手机号码：<em class="emStyle">*</em></h4></td>
                                <td><input id="phone" value="${ownerAddress.recepientPhone }" class="input-text" type="text" onblur="checkPhone()" ></td>
                            </tr>
                            <tr>
                                <td></td>
                                <td class="default-td">
                                <c:if test="${ownerAddress.defaultFlag == 1}">
                                    <input id="defaultAddress" type="checkbox" class="check" checked="checked">
                                </c:if>
                                <c:if test="${ownerAddress.defaultFlag != 1}">
                                    <input id="defaultAddress" type="checkbox" class="check">
                                </c:if>
                                <span class="check-style">设为默认地址</span></td>
                            </tr>
                        </table>
                    </form>
</body>
</html>

